import React, {Component} from 'react'
import { connect } from 'dva';
// import { Link} from 'dva/router';
import Recentlearn from '../components/Recentlearn';
import styles from './Recent.css';
class Recent extends Component {
  constructor(props) {
    super(props)
    this.state = {
      value: ''
    }
  }

  componentDidMount() {
  }
  render(){
    const {classrelation:{hasLearn}} = this.props;
    return (
        <div className = {styles.page}>
        {
          hasLearn.map((value,key)=>{
            return (
              <Recentlearn 
                bgpic = {value.startpic}
                progress = {value.progress}
                title = {value.classname}
                brief = {value.brief}
                key = {key}
              />
            );
          })
        }
        </div>
    );
  }
}

Recent.propTypes = {
};
function mapStateToProps({classrelation}) {
  return {
    classrelation
  }
}
export default connect(mapStateToProps)(Recent);
